import React, { useContext } from 'react';
import { ShowContext } from '@/pages/test/List';
import { Modal } from 'antd';

type AddOrUpdateProps={
  show: boolean;
  title: string;
}

const AddOrUpdate: React.FC<AddOrUpdateProps> = (props) => {
  const { show, title } = props;
  // @ts-ignore
  const { setShow } = useContext(ShowContext);
  const handleOk = () => {
    setShow(false);
  };
  const handleCancel = () => {
    setShow(false);
  };
  return (
    <Modal title={title} visible={show} onOk={handleOk} onCancel={handleCancel}>
      <p>添加弹窗</p>
    </Modal>
  );
}
export default AddOrUpdate;
